<?php
/**
 * Created by PhpStorm.
 * User: sunzexin
 * Date: 2018/1/8
 * Time: 16:36
 */

namespace App\Http\Traits;


use Illuminate\Http\Request;

trait RoleTrait
{
    use BaseTrait;
    // 用户ID
    protected $id;
    // 用户ID
    protected $user_id;
    // 角色名称
    protected $name;
    // 每页条数限制
    protected $limit;
    // 角色ID
    protected $role_id;
    // 角色的菜单json字符串
    protected $menu_list;
    // 是否是小程序
    protected $type;
    // 小程序的app_key
    protected $app_key;
    // 小程序的app_id
    protected $appid;
    // 小程序的secret
    protected $secret;
    // 咖啡馆ID
    protected $cafe_id;
    // 城市ID
    protected $city_id;
    // 角色标记
    protected $mark;
    // 验证秘钥
    protected $loginSession;
    // 系统消息通知需要的form_id
    protected $form_id;
    // 合作者名称
    protected $partner_name;
    // 合作者LOGO
    protected $partner_logo;
    // 合作者简介
    protected $partner_summary;
    // 合作者公众号微信号
    protected $partner_gzh;
    // 合作者公众号名称
    protected $partner_gzh_name;
    // 合作者联系方式
    protected $partner_mobile;
    // 合作者创办时间
    protected $partner_since;

    public function __construct(Request $request)
    {
        $this->id = $request->input('id', 0);
        $this->user_id = $request->input('user_id', 0);
        $this->name = $request->input('name', '');
        $this->limit = $request->input('limit', 0);
        $this->role_id = $request->input('role_id', 0);
        $this->menu_list = $request->input('menu_list', '');
        $this->type = $request->input('type', 0);
        $this->app_key = $request->input('app_key', '');
        $this->appid = $request->input('appid', '');
        $this->secret = $request->input('secret', '');
        $this->cafe_id = $request->input('cafe_id', 0);
        $this->city_id = $request->input('city_id', 0);
        $this->mark = $request->input('mark', '');
        $this->loginSession = $request->input('loginSession', '');
        $this->form_id = $request->input('form_id', '');
        $this->partner_name = $request->input('partner_name', '');
        $this->partner_logo = $request->input('partner_logo', '');
        $this->partner_summary = $request->input('partner_summary', '');
        $this->partner_gzh = $request->input('gzh', '');
        $this->partner_gzh_name = $request->input('partner_gzh_name', '');
        $this->partner_mobile = $request->input('partner_mobile', '');
        $this->partner_since = $request->input('partner_since', '');
    }
}